﻿<%@ Page CodeFileBaseClass="AliCMS.CompanyModule.HomeBase" %>
<%@ Page PathInChannel="index{Ext}" %>
<!doctype html>
<html>
<head>
<!-- TemplateInfo codeOutsideHTMLIsLocked="true" -->
<ali:Get ID="Company" Object="Company" PageID="Request.QueryString['CompanyID']" ForMeta="true" />
<ali:Get ID="Config" Object="HomeConfig" Operation="GetBasicSettings(Convert.ToString(Company[HomeConfig]))" />
<ali:List ID="Industrys" Object="Industry" />
<ali:List ID="Regions" Object="Region" />
<meta charset="utf-8">
<meta name="keywords" content="<%=MetaKeywords%>">
<meta name="description" content="<%=MetaDescription%>">
<title><%=Company[Name]%> - <%=Site[Name]%></title>
<link rel="stylesheet" type="text/css" href="<%=CommonPath%>jquery/themes/lightness/all.css">
<ali:Comment><link rel="stylesheet" type="text/css" href="../S01/CHS/css/global.css"></ali:Comment>
<link rel="stylesheet" type="text/css" href="<%=CssPath("global.css")%>">
<ali:Comment><link rel="stylesheet" type="text/css" href="S01/CHS/css/common.css"></ali:Comment>
<link rel="stylesheet" type="text/css" href="<%=CssPath%>common.css">
<%If Convert.ToString(Config[CustomStyle]) != String.Empty || Convert.ToString(Config[BgColor]) != String.Empty || Convert.ToString(Config[BgImage]) != String.Empty%>
	<style type="text/css">
		<%=Config[CustomStyle]%>
		<%If Convert.ToString(Config[BgColor]) != String.Empty%>
			body{background-color:<%=Config[BgColor]%>}
		<%EndIf%>
		<%If Convert.ToString(Config[BgImage]) != String.Empty%>
			body{background-image:url(<%=Config[BgImage]%>);background-repeat:repeat}
		<%EndIf%>
	</style>
<%EndIf%>
<script language="c#" runat="server">
protected override void OnPreInit(EventArgs e)
{
	SetCompany(Company);
}

protected string BuildRegion()
{
	StringBuilder result = new StringBuilder();

	string url = <%=BuildUrl("Company", "list", "RegionID=_{Region}&IndustryID=_&q=_")%>;
	DataRow[] regions = Regions.Select(Alias.Region.ID + "='" + Company[Alias.Company.RegionID] + "'");
	while (regions.Length != 0)
	{
		if (result.Length > 0)
			result.Insert(0, " &gt; ");
		result.Insert(0, "<a href=\"" + url.Replace("{Region}", regions[0][Alias.Region.PageID].ToString()) + "\">" + regions[0][Alias.Region.Name] + "</a>");
		regions = Regions.Select(Alias.Region.ID + "='" + regions[0][Alias.Region.ParentID] + "'");
	}
	
	return result.ToString();
}

protected string BuildIndustry()
{
	StringBuilder result = new StringBuilder(); 

	string url = <%=BuildUrl("Company", "list", "RegionID=_&IndustryID=_{Industry}&q=_")%>;
	DataRow[] industrys = Industrys.Select(Alias.Industry.ID + "='" + Company[Alias.Company.IndustryID] + "'");
	while (industrys.Length != 0)
	{
		if (result.Length > 0)
			result.Insert(0, " &gt; ");
		result.Insert(0, "<a href=\"" + url.Replace("{Industry}", industrys[0][Alias.Industry.PageID].ToString()) + "\">" + industrys[0][Alias.Industry.Name] + "</a>");
		industrys = Industrys.Select(Alias.Industry.ID + "='" + industrys[0][Alias.Industry.ParentID] + "'");
	}
	
	return result.ToString();
}
</script>
<script>
var _page = "index";
var _webPath = "<%=WebPath%>";
var _id = "<%=Company[InnerID]%>";
</script>
</head>
<body>
<%@ Register TagPrefix="alicmsUC" TagName="TopMenu" Src="../top_menu.dwt.ascx"%><alicmsUC:TopMenu ID="Top" runat="server" />

<widget>
	<div class="Wrap Header">
		<%If Convert.ToString(Config[Banner]) == String.Empty%>
			<h1><%=Company[Name]%></h1>
		<%Else%>
			<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">
				<param name="movie" value="<%=CommonPath%>flicker/01.swf" />
				<param name="quality" value="high" />
				<param name="wmode" value="transparent" />
				<embed src="<%=CommonPath%>flicker/01.swf" quality="high" type="application/x-shockwave-flash" wmode="transparent"></embed>
			</object>
			<img src="<%=Config[Banner]%>" alt="<%=Company[Name]%>" />
		<%EndIf%>
	</div>
</widget>

<!-- TemplateBeginEditable name="菜单" -->
<widget>
	<ali:List ID="MainMenu" Object="Menu" Condition="ParentID IS NULL and Type='Main' and CompanyID=Company[ID]">
		<div class="Wrap Menu">
			<ul>
				<ali:Record>
					<%If IsMenuSelected(Record)%>
						<li><a class="Selected"><span><%=Name%></span></a></li>
					<%Else%>
						<li><a href="<%=BuildMenuUrl(Record)%>"><span><%=Name%></span></a></li>
					<%EndIf%>
					<ali:Separator><li class="Separator"></li></ali:Separator>
				</ali:Record>
			</ul>
		</div>
	</ali:List>
	<%If MainMenu[Count] == 0%>
		<ali:List Object="Menu" Condition="ParentID IS NULL and Type='Main' and CompanyID IS NULL">
			<div class="Wrap Menu">
				<ul>
					<ali:Record>
						<%If IsMenuSelected(Record)%>
							<li><a class="Selected"><span><%=Name%></span></a></li>
						<%Else%>
							<li><a href="<%=BuildMenuUrl(Record)%>"><span><%=Name%></span></a></li>
						<%EndIf%>
						<ali:Separator><li class="Separator"></li></ali:Separator>
					</ali:Record>
				</ul>
			</div>
		</ali:List>
	<%EndIf%>
</widget>
<!-- TemplateEndEditable -->

<div class="Wrap Block1">
	<div class="Side" id="Side">		
		<!-- TemplateBeginEditable name="广告位：视频广告" -->
		<ali:Ad Guid="{9443F58D-0580-4CAC-AF5B-1244969260BE}" TypeID="GetAdTypeID('{9443F58D-0580-4CAC-AF5B-1244969260BE}')" Data="GetAdData('{9443F58D-0580-4CAC-AF5B-1244969260BE}')"></ali:Ad>
		<!-- TemplateEndEditable -->

		<!-- TemplateBeginEditable name="广告位：侧栏顶部" -->
		<ali:Ad Guid="{9EF6FE7E-1278-45FF-AB29-5B3D853EEEAA}" TypeID="GetAdTypeID('{9EF6FE7E-1278-45FF-AB29-5B3D853EEEAA}')" Data="GetAdData('{9EF6FE7E-1278-45FF-AB29-5B3D853EEEAA}')"></ali:Ad>
		<!-- TemplateEndEditable -->
	
		<!-- TemplateBeginEditable name="最新资讯" -->
		<widget>
			<h1><text>最新资讯</text></h1>
			<ul class="List1">
				<ali:List Object="News" Page="1" PageSize="10"  Condition="IsDeleted=false and CompanyID=Company[ID]">
					<ali:Record>
						<li><a href="<%=BuildUrl()%>"><%=Title%></a></li>
					</ali:Record>
				</ali:List>
			</ul>
		</widget>
		<!-- TemplateEndEditable -->

		<!-- TemplateBeginEditable name="最新产品" -->
		<widget>
			<h1><text>最新产品</text></h1>
			<ul class="List2">
				<ali:List Object="Product" Page="1" PageSize="4" Condition="IsDeleted=false and CompanyID=Company[ID]">
					<ali:Record>
						<li>
							<a href="<%=BuildUrl()%>"><img src="<%=Thumbnail%>" alt="<%=Name%>"></a><br>
							<a href="<%=BuildUrl()%>"><%=Name%></a>
						</li>
					</ali:Record>
				</ali:List>
			</ul>
		</widget>
		<!-- TemplateEndEditable -->

		<!-- TemplateBeginEditable name="人才招聘" -->
		<widget>
			<h1><text>人才招聘</text></h1>
			<ul class="List1">
				<ali:List Object="Job" Page="1" PageSize="10" Condition="IsDeleted=false and ExpiredTime > DateTime.Now and CompanyID=Company[ID]">
					<ali:Record>
						<li><a href="<%=BuildUrl("job_index")%>#<%=InnerID%>"><%=Title%></a></li>
					</ali:Record>
				</ali:List>
			</ul>
		</widget>
		<!-- TemplateEndEditable -->

		<!-- TemplateBeginEditable name="友情链接" -->
		<widget>
			<h1><text>友情链接</text></h1>
			<ul class="Link">
				<ali:List Object="Link" Condition="CompanyID=Company[ID]">
					<ali:Record>
						<li><a href="<%=Url%>"><img src="<%=Logo%>" alt="<%=Name%>" /></a></li>
					</ali:Record>
				</ali:List>
			</ul>
		</widget>
		<!-- TemplateEndEditable -->
		
		<!-- TemplateBeginEditable name="广告位：侧栏底部" -->
		<ali:Ad Guid="{B99E2D59-1AF1-411D-A410-53AEFD9052EE}" TypeID="GetAdTypeID('{B99E2D59-1AF1-411D-A410-53AEFD9052EE}')" Data="GetAdData('{B99E2D59-1AF1-411D-A410-53AEFD9052EE}')"></ali:Ad>
		<!-- TemplateEndEditable -->
	</div>
	<div class="Main" id="Main">
		<!-- TemplateBeginEditable name="广告位：轮换广告" -->
		<ali:Ad Guid="{5DA7EDA7-A065-4494-8107-48EC70D512FA}" TypeID="GetAdTypeID('{5DA7EDA7-A065-4494-8107-48EC70D512FA}')" Data="GetAdData('{5DA7EDA7-A065-4494-8107-48EC70D512FA}')"></ali:Ad>
		<!-- TemplateEndEditable -->
		
		<!-- TemplateBeginEditable name="基本信息" -->
		<widget>
			<h1 class="Title1"><a href="<%=BuildUrl("contact")%>"><text>基本信息</text></a></h1>
			<table class="List1">
				<%If Convert.ToString(Company[TypeName]) != ""%>
					<tr><th>企业性质：</th><td><%=Company[TypeName]%></td></tr>
				<%EndIf%>
				<%If Convert.ToString(Company[FoundedDate]) != ""%>
					<tr><th>成立时间：</th><td><%=Convert.ToDateTime(Company[FoundedDate]).ToString("yyyy-MM-dd")%></td></tr>
				<%EndIf%>
				<%If Convert.ToDecimal(Company[RegisteredCapital]) > 0%>
					<tr><th>注册资金：</th><td><%=Company[RegisteredCapital]%>万元</td></tr>
				<%EndIf%>
				<tr><th>主营业务：</th><td><%=Company[BusinessScope]%></td></tr>
				<tr><th>所属行业：</th><td><%=BuildIndustry()%></td></tr>
				<tr><th>所属地区：</th><td><%=BuildRegion()%></td></tr>
			</table>
		</widget>
		<!-- TemplateEndEditable -->

		<!-- TemplateBeginEditable name="公司简介" -->
		<widget>
			<h1 class="Title1"><a href="<%=BuildUrl("about")%>"><text>公司简介</text></a></h1>
			<div class="Content"><%=Company[Description]%></div>
		</widget>
		<!-- TemplateEndEditable -->
			
		<!-- TemplateBeginEditable name="推荐产品" -->
		<widget>
			<h1 class="Title1"><a href="<%=BuildUrl("product_index")%>"><text>推荐产品</text></a></h1>
			<ul class="List3">
				<ali:List Object="Product" Page="1" PageSize="Config[RecommendedProductPageSize]" Condition="IsDeleted=false and IsRecommended=true and CompanyID=Company[ID]" Sort="Recommend DESC">
					<ali:Record>
						<li><a href="<%=BuildUrl()%>" target="_blank"><img src="<%=Thumbnail%>" alt="<%=Name%>"></a><br><a href="<%=BuildUrl()%>" target="_blank"><%=Name%></a></li>		
					</ali:Record>
				</ali:List>
			</ul>
		</widget>
		<!-- TemplateEndEditable -->
			
		<!-- TemplateBeginEditable name="荣誉资质" -->
		<widget>
			<ali:List Object="License" Page="1" PageSize="Config[LicensePageSize]" Condition="IsDeleted=false and CompanyID=Company[ID]">
				<h1 class="Title1"><a href="<%=BuildUrl("license_index")%>"><text>荣誉资质</text></a></h1>
				<ul class="List3">
					<ali:Record>
						<li>
							<a href="<%=BuildUrl()%>" target="_blank"><img src="<%=Thumbnail%>" alt="<%=Name%>"></a><br>
							<a href="<%=BuildUrl()%>" target="_blank"><%=Name%></a>
						</li>
					</ali:Record>
				</ul>
			</ali:List>
		</widget>
		<!-- TemplateEndEditable -->
	</div>
</div>

<!-- TemplateBeginEditable name="广告位：页面底部" -->
<ali:Ad Guid="{67C25026-1722-462E-A6DE-FD8AD50E37BA}" TypeID="GetAdTypeID('{67C25026-1722-462E-A6DE-FD8AD50E37BA}')" Data="GetAdData('{67C25026-1722-462E-A6DE-FD8AD50E37BA}')"></ali:Ad>
<!-- TemplateEndEditable -->

<!-- TemplateBeginEditable name="脚注" -->
<widget>
	<div class="Wrap Footer">
		<ali:List ID="FooterMenu" Object="Menu" Condition="ParentID IS NULL and Type='Footer' and CompanyID=Company[ID]">
			<ali:Record>
				<a href="<%=BuildMenuUrl(Record)%>"><%=Name%></a>
				<ali:Separator>|</ali:Separator>
			</ali:Record>
		</ali:List>
		<%If FooterMenu[Count] == 0%>
			<ali:List Object="Menu" Condition="ParentID IS NULL and Type='Footer' and CompanyID IS NULL">
				<ali:Record>
					<a href="<%=BuildMenuUrl(Record)%>"><%=Name%></a>
					<ali:Separator>|</ali:Separator>
				</ali:Record>
			</ali:List>
		<%EndIf%>
		<hr size="1" />
	
		<%=Config[Footer]%>
	</div>
</widget>
<!-- TemplateEndEditable -->

<!-- TemplateBeginEditable name="广告位：弹窗广告" -->
<ali:Ad Guid="{7B134455-01CA-4924-8090-72008A21CEC5}" TypeID="GetAdTypeID('{7B134455-01CA-4924-8090-72008A21CEC5}')" Data="GetAdData('{7B134455-01CA-4924-8090-72008A21CEC5}')"></ali:Ad>
<!-- TemplateEndEditable -->
		
<!-- TemplateBeginEditable name="广告位：对联广告" -->
<ali:Ad Guid="{4AF86E57-6345-47D4-A5B9-B9991B77B39F}" TypeID="GetAdTypeID('{4AF86E57-6345-47D4-A5B9-B9991B77B39F}')" Data="GetAdData('{4AF86E57-6345-47D4-A5B9-B9991B77B39F}')"></ali:Ad>
<!-- TemplateEndEditable -->
		
<!-- TemplateBeginEditable name="广告位：漂浮广告" -->
<ali:Ad Guid="{9091DC76-3E76-4A9E-A505-C9B19B9579F3}" TypeID="GetAdTypeID('{9091DC76-3E76-4A9E-A505-C9B19B9579F3}')" Data="GetAdData('{9091DC76-3E76-4A9E-A505-C9B19B9579F3}')"></ali:Ad>
<!-- TemplateEndEditable -->

<script src="<%=CommonPath%>jquery/core.js"></script>
<script src="<%=CommonPath%>jquery/ui.js"></script>
<script src="<%=CommonPath%>equalcols.js"></script>
<script src="<%=CommonPath%>jquery/marquee.js"></script>
<script src="<%=CommonPath%>utility.js"></script>
<script src="<%=JsPath("global.js")%>"></script>
<script src="<%=JsPath%>common.js"></script>
<%=StatisticsCode%>
<%=Config[StatCode]%>
</body>
</html>
